package logic.newLogic2;

import guiDisplay.MovieComputedRating;
import exceptions.ObjectAlreadyInitializedException;

public class ToGuiFacade3 {
	private static ToGuiFacade3 _facade;

	private ToGuiFacade3(){
	}
	
	public static ToGuiFacade3 getInstance(){
		if (_facade==null){
			_facade = new ToGuiFacade3();
		}
		return _facade;
	}

	public static void init() throws ObjectAlreadyInitializedException{
		if (_facade == null){
			_facade = new ToGuiFacade3();
		}else{
			throw new ObjectAlreadyInitializedException("ToGuiFacade already initialized");
		}
	}
	public String passwordsDontMatch() {
		return "userRegistration.jsp?error=The passwords given don't match";
	}

	public String missingMandantoryField() {
		return "userRegistration.jsp?error=mandatory field missing";
	}
	
	public String userAlreadyExists() {
		return "userRegistration.jsp?error=user already exists";
	}

	public void showMovieScreen(String string, String user){
		//TODO
	}

	public String showUserScreenAfterRating(String user, boolean isAdmin) {
		//TODO
		return null;
	}
	public String showLoginErrorScreen(String string) {
		return "login.jsp?error="+string;
	}
	public String showLoginScreen() {
		return "login.html";
	}
	public void showDeleteUserScreen(String user) {
		//TODO
	}
	public void showDeleteMovieScreen(String user) {
		//TODO
	}
	public String showDeleteMovieMessage() {
		//TODO
		//_pnlRemoveMovieScreen.setAlertLabel("Movie succesfully removed");
		return null;
	}
	public String showDeleteUserMessage() {
		//TODO;
		return null;
	}
	public void showAddMovieScreen(String user) {
		//TODO
	}
	public String showRecMovies(MovieComputedRating[] recs, int begin) {
		// TODO 
		return null;
	}
	public void showRecs(MovieComputedRating[] recs, int begin) {
		//TODO
		//gui.pnlRecommendation.setMovies(recs, begin);
	}
	public void nextTenMoviesToRate(String[] movs, int begin) {
		//TODO
		//gui.pnlRecommendationList.setMovies(movs, begin);
	}

	public String setRemoveRatingButton(boolean b) {
		//TODO
		return null;
	}

	public String wrongPasswordChange() {
		//TODO
		return null;
	}
	public String passwordsDontMatchOnUserChange() {
		//TODO
		return null;
	}
	public String showUserScreenAfterChangeDetails(String name, boolean admin) {
		//TODO
		return null;
	}
	
	public void showChangeDetailsScreen(String user) {
		//TODO
	}

	public String showUserScreen(String get_name, boolean admin) {
			if (admin){
				return "adminPanel.htm";
			} else {
				return "userPanel.htm";
			}
			//TODO why Object?
			//TODO save session - access denied when requesting an internal page
	}
	public String addMovieMsg(boolean addedMovie){
		if (!addedMovie){
			return "addMovie.jsp?error=movie already exists";
		} else
			return "addMovie.jsp?error=movie added succesfully";
	}
	
	public String showDeleteUserMessage(boolean b) { 
		if(b){
			return "removeUser.jsp?msg=User succesfully removed";
		}else {
			return "removeUser.jsp?msg=problem deleting the user";
		}
	}
	
	public String showDeleteUserErrorMessage(String string) {
		// TODO
		return null;
	}
}
